var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
import { defineComponent, ref, computed, onMounted, h, watch, nextTick, onBeforeUnmount, resolveComponent, createElementBlock, openBlock, createElementVNode, createCommentVNode, withModifiers, toDisplayString, normalizeStyle, createVNode, withDirectives, Fragment, renderList, createBlock, vShow, resolveDirective, normalizeClass, withCtx, normalizeProps, guardReactiveProps, mergeProps, mergeModels, useModel, unref, createTextVNode, getCurrentInstance } from "vue";
import { ElIcon, ElSelect, ElOption, ElInput, ElMessage, ElTree, ElMessageBox } from "element-plus";
import { CircleClose, CircleCheck, Plus, Minus, MoreFilled, Edit, CirclePlus } from "@element-plus/icons-vue";
import { defineStore } from "pinia";
import * as echarts from "echarts";
import Split from "split.js";
const _sfc_main$5$1 = defineComponent({
  name: "NodeValue",
  props: {
    data: {
      type: Object,
      required: true
    },
    readonly: {
      type: Boolean,
      required: true
    }
  },
  setup(props, context) {
    const isHasFocus = ref(false);
    const validText = ref("");
    const checkText = ref("");
    const validTypeArr = ["Integer", "BitString", "NumericString", "Ia5string", "OctetString", "String"];
    const otherProps = computed(() => {
      return props.data.bitArray ? props.data.bitArray.map((x) => x ? 1 : 0).join("") : "";
    });
    const formValid = (data) => {
      if (data.isRequired && data.value === "") {
        validText.value = "字段必填";
        return;
      }
      if (data.controlType === "Integer") {
        const { minInclusive, maxInclusive, value } = data;
        if (!minInclusive && !maxInclusive) {
          checkText.value = validText.value = "";
          return;
        }
        if (Number(value) < minInclusive) {
          validText.value = `最小值为${minInclusive}`;
          return;
        }
        if (Number(value) > maxInclusive) {
          validText.value = `最大值为${maxInclusive}`;
          return;
        }
      } else if (data.controlType === "BitString") {
        const { Length } = data;
        checkText.value = `长度为${Length}的二进制数`;
        if (otherProps.value.length !== Length) {
          validText.value = `长度应为${Length}`;
          return;
        }
      }
      validText.value = "";
    };
    const updateEmit = () => {
      if (validText.value === "") {
        context.emit("updateForm", props.data);
      }
    };
    const publicEvent = {
      onfocus: () => {
        isHasFocus.value = true;
      },
      onblur: () => {
        isHasFocus.value = false;
      }
    };
    onMounted(() => {
    });
    const strategy = {
      Integer: (data) => {
        const { value, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          disabled,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: (val) => {
            if (!value) return;
            data.value = parseFloat(val);
            updateEmit();
          },
          ...publicEvent
        });
      },
      Ia5string: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: () => {
            updateEmit();
          },
          ...publicEvent
        });
      },
      String: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          // 保持原有类名 + 组件基础类
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: () => {
            updateEmit();
          },
          ...publicEvent
        });
      },
      OctetString: (data) => {
        const { value, minLength, isReadOnly: disabled } = data;
        return h(ElInput, {
          class: ["int-input", "el-input"],
          modelValue: value,
          // 双向绑定值
          readonly: props.readonly,
          attrs: { minlength: minLength, readonly: props.readonly },
          "onUpdate:modelValue": (val) => {
            data.value = val;
            formValid(data);
          },
          onChange: (val) => {
            const is16Hex = /^[\-A-Fa-f0-9\s]*$/.test(val);
            if (is16Hex) {
              const newValue = value !== "" ? String(value).replace(/\s+/g, "").match(new RegExp("[^\\n]{1,2}", "g")).join(" ") : "";
              data.value = newValue;
              formValid(data);
              updateEmit();
            }
          }
        });
      },
      // NumericString: (data: nodeItem) => {
      //   const { Value: value, MinLength, IsReadOnly: disabled } = data;
      //   return h("el-input", {
      //     class: "int-input",
      //     props: { value, disabled },
      //     attrs: { minlength: MinLength, readonly: props.readonly },
      //     on: {
      //       input: (value: string) => {
      //         const isNumber = /^[\.\-0-9]*$/.test(value);
      //         if (isNumber) {
      //           data.Value = value;
      //           formValid(data);
      //         }
      //       },
      //       ...publicEvent,
      //     },
      //   });
      // },
      // BitString: (data: nodeItem) => {
      //   const { IsReadOnly: disabled } = data;
      //   const { value } = otherProps;
      //   return h("el-input", {
      //     class: "int-input",
      //     props: { otherProps.value.value, disabled },
      //     attrs: { readonly: props.readonly },
      //     on: {
      //       input: (value: string) => {
      //         const isBinary = /^[0|1]*$/.test(value);
      //         if (isBinary) {
      //           data.OtherProps = value;
      //           formValid(data);
      //         }
      //       },
      //       change: (value: string) => {
      //         data.BitArray = value.split("").map(x => !!Number(x));
      //       },
      //       ...publicEvent,
      //     },
      //   });
      // },
      Enum: (data) => {
        const { value, constraint, isReadOnly: disabled } = data;
        const options = [];
        constraint == null ? void 0 : constraint.forEach((optionValue) => {
          options.push({ label: optionValue, value: optionValue });
        });
        return h(
          ElSelect,
          {
            class: "custom-el-select",
            // 添加自定义类名
            modelValue: data.value,
            "onUpdate:modelValue": (val) => {
              data.value = val;
            },
            onChange: () => {
              updateEmit();
            },
            size: "small"
          },
          [
            ...options.map(
              (option) => h(ElOption, {
                key: option.value,
                label: option.label,
                value: option.value
              })
            )
          ]
        );
      },
      // Choice: (data: nodeItem) => {
      //   const { Value: value, Constraint, IsReadOnly: disabled } = data;
      //   const optionsArr = Constraint.map(value => {
      //     if (typeof value === "string") return;
      //     return h("el-option", { props: { label: value.Name, value } });
      //   });
      //   return h(
      //     "el-select",
      //     {
      //       class: "enum-select",
      //       props: { value, valueKey: "Name", placeholder: " ", disabled: disabled || props.readonly },
      //       on: {
      //         input: (value: string) => {
      //           data.Value = value;
      //         },
      //       },
      //     },
      //     [optionsArr],
      //   );
      // },
      Boolean: (data) => {
        const options = [
          { label: "是", value: true },
          { label: "否", value: false }
        ];
        return h(
          ElSelect,
          {
            class: "custom-el-select",
            // 添加自定义类名
            modelValue: data.value,
            "onUpdate:modelValue": (val) => {
              data.value = val;
            },
            onChange: () => {
              updateEmit();
            },
            size: "small"
          },
          [
            ...options.map(
              (option) => h(ElOption, {
                label: option.label,
                value: option.value
              })
            )
          ]
        );
      },
      Sequence: () => {
        return h("div", {}, "");
      },
      SequenceList: (data) => {
        const max = 9999;
        const min = 0;
        const len = data.child && data.child.length;
        const elementName = "成员";
        return h("div", { class: "sequence-list-value" }, [
          h(
            "div",
            {
              class: "btn-icon"
            },
            [
              h(
                ElIcon,
                {
                  class: `el-icon-plus ${len < max ? "" : "gray"}`,
                  onClick: () => {
                    if (len < max) {
                      const addRow = data.elementForm;
                      const count = data.child ? data.child.length + 1 : 1;
                      if (addRow) {
                        addRow.name = `${elementName}(${count})`;
                      }
                      data.child.push(JSON.parse(JSON.stringify(addRow)));
                      updateEmit();
                    }
                  }
                },
                [h(Plus)]
              ),
              h(
                ElIcon,
                {
                  class: `el-icon-minus ${len > min ? "" : "gray"}`,
                  onClick: () => {
                    if (len > min) {
                      data.child.pop();
                      updateEmit();
                    }
                  }
                },
                [h(Minus)]
              )
            ]
          )
          // h("span", { class: "valid-text" }, validText),
        ]);
      },
      // 其他控件类型的渲染逻辑...
      default: (data) => {
        return h("div", {}, `未定义的控件类型: ${data.controlType}`);
      }
    };
    formValid(props.data);
    return () => {
      return h(
        "div",
        {
          class: {
            "node-value": true,
            "node-valid-error": validText.value
          }
        },
        [
          (strategy[props.data.controlType] || strategy.default)(props.data),
          validTypeArr.includes(props.data.controlType) && h("span", { class: "valid-icon" }, [
            [
              validText.value ? h(ElIcon, { color: "red", size: 16 }, [h(CircleClose)]) : isHasFocus.value && !props.readonly && h(ElIcon, { color: "#67c23a", size: 16 }, [h(CircleCheck)])
            ],
            isHasFocus.value && validText.value && h("div", { class: "valid-tips err" }, validText.value),
            !validText.value && !props.readonly && isHasFocus.value && checkText.value && h("div", { class: "valid-tips" }, checkText.value)
          ])
        ]
      );
    };
  }
});
const _export_sfc$1 = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const NodeValue = /* @__PURE__ */ _export_sfc$1(_sfc_main$5$1, [["__scopeId", "data-v-a8b820df"]]);
const systolicIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<g id="HTSCIT_&#229;&#177;&#149;&#229;&#188;&#128; 2">\r\n<path id="Vector" d="M6.27673 6.28553H17.7233V17.7409H6.27673V6.28553ZM5 5.00881V19H19V5H5V5.00881Z" fill="currentColor"/>\r\n<path id="Vector_2" d="M8 13V11H16V13H8Z" fill="#3a6ef6"/>\r\n</g>\r\n</svg>\r\n';
const expandIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<g id="HTSCIT_&#229;&#177;&#149;&#229;&#188;&#128; 1">\r\n<path id="Vector" d="M6.27673 6.28553H17.7233V17.7409H6.27673V6.28553ZM5 5.00881V19H19V5H5V5.00881Z" fill="currentColor"/>\r\n<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M12.5471 8.1925H11.4528V11.4642H8.18115V12.5585H11.4528V15.8302H12.5471V12.5585H15.8189V11.4642H12.5471V8.1925Z" fill="#3a6ef6"/>\r\n</g>\r\n</svg>\r\n';
const toolIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M13.9498 6C14.8591 6 15.699 6.29966 16.3746 6.80641L15.1183 8.06172L13.892 9.28926L14.7099 10.1078L17.1925 7.62438C17.7138 8.32091 17.997 9.16685 18 10.0369C18.003 10.9069 17.7257 11.7548 17.2093 12.4549C16.6928 13.1551 15.9646 13.6702 15.1325 13.9241C14.3004 14.178 13.4087 14.1571 12.5894 13.8645L8.98345 17.4702C8.82338 17.6359 8.6319 17.7682 8.42019 17.8591C8.20848 17.9501 7.98077 17.9979 7.75036 17.9999C7.51995 18.0019 7.29145 17.958 7.07819 17.8708C6.86493 17.7835 6.67118 17.6546 6.50825 17.4917C6.34532 17.3288 6.21647 17.135 6.12922 16.9217C6.04197 16.7084 5.99806 16.4799 6.00007 16.2495C6.00207 16.019 6.04994 15.7913 6.14088 15.5796C6.23183 15.3678 6.36402 15.1763 6.52976 15.0163L10.1351 11.41C9.9171 10.7988 9.84914 10.1442 9.93696 9.5013C10.0248 8.85838 10.2658 8.24598 10.6397 7.71569C11.0137 7.1854 11.5095 6.75274 12.0856 6.45416C12.6616 6.15558 13.301 5.99982 13.9498 6Z" fill="currentColor"/>\r\n</svg>\r\n';
const _sfc_main$4$1 = defineComponent({
  name: "NodeItem",
  components: {
    NodeValue
  },
  props: {
    data: {
      type: Object,
      required: true
    },
    w: {
      type: Number,
      required: true
    },
    readonly: {
      type: Boolean,
      required: true
    }
  },
  setup(props, { emit }) {
    const isExpand = ref(props.data.isExpand !== false);
    const isChildren = computed(() => {
      return props.data.child && props.data.child.length > 0;
    });
    const handleUpdate = (data) => {
      emit("updateForm", data);
    };
    return {
      isExpand,
      isChildren,
      handleUpdate,
      systolicIcon,
      expandIcon,
      toolIcon
    };
  }
});
const _hoisted_1$2$1 = { class: "node-view" };
const _hoisted_2$2 = { class: "node-item" };
const _hoisted_3$1$1 = { class: "left-item" };
const _hoisted_4$2 = { class: "icon-view" };
const _hoisted_5$2 = ["innerHTML"];
const _hoisted_6$2 = ["innerHTML"];
const _hoisted_7$2 = { class: "label-view" };
const _hoisted_8$2 = {
  key: 0,
  class: "node-children"
};
const _hoisted_9$1 = {
  key: 1,
  class: "node-children"
};
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_NodeValue = resolveComponent("NodeValue");
  const _component_NodeItem = resolveComponent("NodeItem", true);
  return openBlock(), createElementBlock("div", _hoisted_1$2$1, [
    createElementVNode("div", _hoisted_2$2, [
      createElementVNode("div", _hoisted_3$1$1, [
        createElementVNode("div", _hoisted_4$2, [
          _ctx.isChildren ? (openBlock(), createElementBlock("span", {
            key: 0,
            class: "ex-icon force-svg-16",
            innerHTML: _ctx.isExpand ? _ctx.systolicIcon : _ctx.expandIcon,
            onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.isExpand = !_ctx.isExpand, ["stop"]))
          }, null, 8, _hoisted_5$2)) : (openBlock(), createElementBlock("span", {
            key: 1,
            class: "icon",
            innerHTML: _ctx.toolIcon
          }, null, 8, _hoisted_6$2))
        ]),
        createElementVNode("div", _hoisted_7$2, toDisplayString(_ctx.data.name), 1)
      ]),
      createElementVNode("div", {
        class: "right-item",
        style: normalizeStyle({ width: _ctx.w ? `${_ctx.w / 2}px` : "" })
      }, [
        createVNode(_component_NodeValue, {
          data: _ctx.data,
          readonly: _ctx.readonly,
          onUpdateForm: _ctx.handleUpdate
        }, null, 8, ["data", "readonly", "onUpdateForm"])
      ], 4)
    ]),
    _ctx.isChildren ? (openBlock(), createElementBlock("div", _hoisted_8$2, [
      withDirectives(createElementVNode("div", null, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.child, (x, i) => {
          return openBlock(), createBlock(_component_NodeItem, {
            key: i,
            data: x,
            w: _ctx.w,
            readonly: _ctx.readonly,
            onUpdateForm: _ctx.handleUpdate
          }, null, 8, ["data", "w", "readonly", "onUpdateForm"]);
        }), 128))
      ], 512), [
        [vShow, _ctx.isExpand]
      ])
    ])) : createCommentVNode("", true),
    _ctx.data.controlType === "Choice" && _ctx.data.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
      (openBlock(true), createElementBlock(Fragment, null, renderList([_ctx.data.value], (x, i) => {
        return openBlock(), createBlock(_component_NodeItem, {
          key: i,
          data: x,
          w: _ctx.w,
          readonly: _ctx.readonly,
          onUpdateForm: _ctx.handleUpdate
        }, null, 8, ["data", "w", "readonly", "onUpdateForm"]);
      }), 128))
    ])) : createCommentVNode("", true)
  ]);
}
const NodeItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$1, [["render", _sfc_render$1], ["__scopeId", "data-v-49690e0a"]]);
const _sfc_main$3$1 = defineComponent({
  name: "NodeTree",
  components: {
    NodeItem
  },
  props: {
    data: {
      type: Array,
      required: true
    },
    isHideHeader: {
      type: Boolean,
      default: false
    },
    readonly: {
      type: Boolean,
      default: false
    },
    isLoading: {
      type: Boolean,
      default: false
    }
  },
  setup(props, { emit }) {
    const treeTbodyW = ref(0);
    const treeTbody = ref(null);
    const scrollbar = ref(null);
    watch(
      () => props.data.length,
      () => {
        nextTick(() => {
          updateTreeTbodyWidth();
        });
      }
    );
    const updateTreeTbodyWidth = () => {
      if (treeTbody.value) {
        treeTbodyW.value = treeTbody.value.offsetWidth;
      }
    };
    const handleResize = () => {
      updateTreeTbodyWidth();
    };
    onMounted(() => {
      window.addEventListener("resize", handleResize);
    });
    onBeforeUnmount(() => {
      window.removeEventListener("resize", handleResize);
    });
    const handleUpdate = (data) => {
      emit("updateForm", data);
    };
    return {
      treeTbodyW,
      treeTbody,
      scrollbar,
      handleUpdate
    };
  }
});
const _hoisted_1$1$1 = { class: "node-content" };
const _hoisted_2$1$1 = { class: "tree-thead" };
const _hoisted_3$2 = {
  ref: "treeTbody",
  class: "tree-tbody"
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_NodeItem = resolveComponent("NodeItem");
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
  const _component_Empty = resolveComponent("Empty");
  const _directive_loading = resolveDirective("loading");
  return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$1$1, [
    withDirectives(createElementVNode("div", _hoisted_2$1$1, [
      _cache[0] || (_cache[0] = createElementVNode("div", { class: "item" }, "名称", -1)),
      createElementVNode("div", {
        class: "item",
        style: normalizeStyle({ width: _ctx.treeTbodyW ? `${_ctx.treeTbodyW / 2}px` : "" })
      }, "值", 4)
    ], 512), [
      [vShow, !_ctx.isHideHeader && _ctx.data.length]
    ]),
    withDirectives(createVNode(_component_el_scrollbar, {
      ref: "scrollbar",
      class: normalizeClass(["tree-scrollbar", _ctx.data.length ? "" : "fill-scroll"])
    }, {
      default: withCtx(() => [
        createElementVNode("div", _hoisted_3$2, [
          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (x, i) => {
            return openBlock(), createBlock(_component_NodeItem, {
              key: i,
              data: x,
              w: _ctx.treeTbodyW,
              readonly: _ctx.readonly,
              onUpdateForm: _ctx.handleUpdate
            }, null, 8, ["data", "w", "readonly", "onUpdateForm"]);
          }), 128))
        ], 512)
      ]),
      _: 1
    }, 8, ["class"]), [
      [vShow, _ctx.data.length]
    ]),
    withDirectives(createVNode(_component_Empty, { class: "null-box" }, null, 512), [
      [vShow, !_ctx.data.length && !_ctx.isLoading]
    ])
  ])), [
    [_directive_loading, _ctx.isLoading]
  ]);
}
const index = /* @__PURE__ */ _export_sfc$1(_sfc_main$3$1, [["render", _sfc_render], ["__scopeId", "data-v-c3f35861"]]);
const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
  __name: "Empty",
  props: {
    props: { default: () => ({}) }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      const _component_el_empty = resolveComponent("el-empty");
      return openBlock(), createBlock(_component_el_empty, normalizeProps(guardReactiveProps(_ctx.props)), null, 16);
    };
  }
});
const Empty = /* @__PURE__ */ _export_sfc$1(_sfc_main$1$1, [["__scopeId", "data-v-d68485ba"]]);
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
  ...{
    name: "TooltipBox"
  },
  __name: "TooltipBox",
  props: {
    content: { default: "" },
    required: { type: Boolean, default: false },
    tooltipAttrs: { default: () => ({
      placement: "top-start",
      openDelay: 0
    }) }
  },
  setup(__props) {
    const isShowTip = ref(false);
    const checkShowTip = (event) => {
      const target = event.currentTarget;
      isShowTip.value = target.clientWidth < target.scrollWidth;
    };
    return (_ctx, _cache) => {
      const _component_el_tooltip = resolveComponent("el-tooltip");
      return openBlock(), createBlock(_component_el_tooltip, mergeProps({
        effect: "dark",
        content: _ctx.content,
        disabled: !isShowTip.value,
        tabindex: -1
      }, _ctx.tooltipAttrs), {
        default: withCtx(() => [
          createElementVNode("div", {
            class: normalizeClass(["name one-line", { required: _ctx.required }]),
            onMouseenter: checkShowTip
          }, toDisplayString(_ctx.content), 35)
        ]),
        _: 1
      }, 16, ["content", "disabled"]);
    };
  }
});
const TooltipBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["__scopeId", "data-v-7bfdccdf"]]);
const SEND_CALIBRATION_CMD_KEY = "send-calibration-cmd";
const GET_CALIBRATION_DATA_KEY = "get-calibration-data";
const useCalibrationStore = defineStore("calibrationInjection", () => {
  const sendCalibrationCmd = ref(null);
  const setInjections = (injections) => {
    if (injections.sendCalibrationCmd) {
      sendCalibrationCmd.value = injections.sendCalibrationCmd;
    }
  };
  return { sendCalibrationCmd, setInjections };
});
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
  __name: "AddDialog",
  props: /* @__PURE__ */ mergeModels({
    detail: { default: () => ({}) },
    apiConfig: { default: () => ({}) },
    currentKey: { default: "" }
  }, {
    "modelValue": { type: Boolean },
    "modelModifiers": {}
  }),
  emits: /* @__PURE__ */ mergeModels(["update"], ["update:modelValue"]),
  setup(__props, { emit: __emit }) {
    const authStore = {
      calibrationName: "开场校准管理器"
    };
    const emits = __emit;
    const visible = useModel(__props, "modelValue");
    const props = __props;
    const title = computed(() => {
      const { children, pName, name } = props.detail;
      return children ? "新增" + name : "修改" + pName;
    });
    const isAdd = computed(() => !!props.detail.children);
    const hasParams = computed(() => ["lineinfo", "positioninfo"].includes(props.currentKey));
    const tableConfig = ref([]);
    const state = ref("");
    const formData = ref({});
    const formView = ref(null);
    const params = ref([]);
    const isLoading = ref(false);
    const init = () => {
      let config2 = [
        { label: "名称", prop: "name", required: true },
        { label: "参数", prop: "params", type: "slot", slot: "params" }
      ];
      if (["freqscope", "antennafactor"].includes(props.currentKey)) {
        config2 = config2.slice(0, 1);
      }
      tableConfig.value = config2;
      nextTick(() => {
        if (isAdd.value) {
          getAddParams();
        } else {
          params.value = JSON.parse(JSON.stringify(props.detail.params || []));
          getInfo();
        }
      });
    };
    const getAddParams = async () => {
      const { getParams } = props.apiConfig;
      if (getParams) {
        isLoading.value = true;
        const apiParams = {};
        if (props.currentKey === "lineinfo") {
          apiParams.calibrationType = props.detail.id;
        }
        const { data } = await getParams(apiParams, { calibrationName: authStore.calibrationName });
        params.value = data || [];
        isLoading.value = false;
      }
    };
    const getInfo = async () => {
      formData.value = {};
      Object.entries(props.detail || {}).forEach(([key, value]) => {
        if (key !== "params") {
          formData.value[key] = value;
        }
      });
    };
    const submit = async ({ value, done }) => {
      try {
        const { id, pId, calibrationType } = props.detail;
        const { add, edit, addKey, editKey } = props.apiConfig;
        const api = isAdd.value ? add : edit;
        await api(
          {
            [isAdd.value ? addKey : editKey || addKey]: {
              name: value.name,
              calibrationType: calibrationType || (pId === "lineinfo" ? id : void 0),
              id: isAdd.value ? "" : id,
              params: hasParams.value ? params.value : void 0
            }
          },
          { calibrationName: authStore.calibrationName }
        );
        done == null ? void 0 : done();
        visible.value = false;
        ElMessage({ type: "success", message: isAdd.value ? "新增成功" : "修改成功" });
        emits("update");
      } catch {
        done == null ? void 0 : done();
      }
    };
    const close = () => {
      formData.value = {};
    };
    return (_ctx, _cache) => {
      const _component_NodeTree = resolveComponent("NodeTree");
      const _component_XcForm = resolveComponent("XcForm");
      const _directive_loading = resolveDirective("loading");
      return openBlock(), createBlock(_component_XcForm, {
        ref_key: "formView",
        ref: formView,
        key: tableConfig.value.length,
        visible: visible.value,
        "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
        state: state.value,
        closeReset: true,
        title: title.value,
        config: tableConfig.value,
        values: formData.value,
        isDialog: "",
        colProps: 12,
        dialogWidth: hasParams.value ? 900 : 500,
        dialogHeight: hasParams.value ? 500 : 200,
        dialogMaximize: "",
        onOpen: init,
        onClose: close,
        onSubmit: submit
      }, {
        params: withCtx(() => [
          withDirectives(createVNode(_component_NodeTree, {
            class: "node-tree",
            data: params.value
          }, null, 8, ["data"]), [
            [_directive_loading, isLoading.value]
          ])
        ]),
        _: 1
      }, 8, ["visible", "state", "title", "config", "values", "dialogWidth", "dialogHeight"]);
    };
  }
});
function createCommand(moduleId2, fixedParams) {
  return async function(data, params, config2 = {}) {
    const calibStore = useCalibrationStore();
    const sendCalibrationCmd = calibStore.sendCalibrationCmd;
    if (!sendCalibrationCmd) {
      throw new Error("sendCalibrationCmd 未在 Pinia 中初始化，请检查插件根组件是否正常挂载");
    }
    const commandPayload = {
      moduleId: moduleId2,
      fixedParams,
      data,
      params: { ...fixedParams, ...params },
      config: config2
    };
    const result = await sendCalibrationCmd("execute", commandPayload);
    return result;
  };
}
const moduleId = "CalibrationForm";
const getFreqScopes = createCommand(moduleId, { command: "GetFreqScopes" });
const addFreqScope = createCommand(moduleId, { command: "AddFreqScope" });
const updateFreqScope = createCommand(moduleId, { command: "UpdateFreqScope" });
const removeFreqScope = createCommand(moduleId, { command: "RemoveFreqScope" });
const getFreqBands = createCommand(moduleId, { command: "GetFreqBands" });
const addFreqBand = createCommand(moduleId, { command: "AddFreqBand" });
const removeFreqBand = createCommand(moduleId, { command: "RemoveFreqBand" });
const getAntennaFactors = createCommand(moduleId, { command: "GetAntennaFactors" });
const addAntennaFactory = createCommand(moduleId, { command: "AddAntennaFactory" });
const updateAntennaFactory = createCommand(moduleId, { command: "UpdateAntennaFactory" });
const removeAntennaFactory = createCommand(moduleId, { command: "RemoveAntennaFactory" });
const getAntennaFactorResults = createCommand(moduleId, { command: "GetAntennaFactorResults" });
const addAntennaFactorResult = createCommand(moduleId, { command: "AddAntennaFactorResult" });
const removeAntennaFactorResult = createCommand(moduleId, { command: "RemoveAntennaFactorResult" });
const getCreateLineParams = createCommand(moduleId, { command: "GetCreateLineParams" });
const getReferenceLines = createCommand(moduleId, { command: "GetReferenceLines" });
const getCableLines = createCommand(moduleId, { command: "GetCableLines" });
const addLine = createCommand(moduleId, { command: "AddLine" });
const updateLine = createCommand(moduleId, { command: "UpdateLine" });
const removeLine = createCommand(moduleId, { command: "RemoveLine" });
const getLineCalResults = createCommand(moduleId, { command: "GetLineCalResults" });
const getCreatePositionParams = createCommand(moduleId, { command: "GetCreatePositionParams" });
const getPositionCalInfos = createCommand(moduleId, { command: "GetPositionCalInfos" });
const addPosition = createCommand(moduleId, { command: "AddPosition" });
const updatePositionCal = createCommand(moduleId, { command: "UpdatePositionCal" });
const removePositionCal = createCommand(moduleId, { command: "RemovePositionCal" });
const getPositionCalResults = createCommand(moduleId, { command: "GetPositionCalResults" });
const startAdjust = createCommand(moduleId, { command: "Start" });
const stopAdjust = createCommand(moduleId, { command: "Stop" });
const getCurrentInstrumneForms = createCommand(moduleId, { command: "GetCurrentInstrumneForms" });
const setCalibrationInstruments = createCommand(moduleId, { command: "SetCalibrationInstruments" });
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
  __name: "InstrumneForm",
  props: {
    "modelValue": { type: Boolean },
    "modelModifiers": {}
  },
  emits: ["update:modelValue"],
  setup(__props) {
    const authStore = {
      calibrationName: "开场校准管理器"
    };
    const visible = useModel(__props, "modelValue");
    const tableConfig = ref([{ label: "", prop: "params", type: "slot", slot: "params" }]);
    const params = ref([]);
    const isLoading = ref(true);
    const init = () => {
      getParams();
    };
    const getParams = async () => {
      isLoading.value = true;
      const { data } = await getCurrentInstrumneForms({}, { calibrationName: authStore.calibrationName });
      isLoading.value = false;
      params.value = data || [];
    };
    const submit = async ({ done }) => {
      try {
        await setCalibrationInstruments({ setform: params.value }, { calibrationName: authStore.calibrationName });
        visible.value = false;
      } finally {
        done();
      }
    };
    return (_ctx, _cache) => {
      const _component_XcForm = resolveComponent("XcForm");
      const _directive_loading = resolveDirective("loading");
      return openBlock(), createBlock(_component_XcForm, {
        ref: "formView",
        key: tableConfig.value.length,
        visible: visible.value,
        "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
        closeReset: true,
        title: "修改校准配置",
        config: tableConfig.value,
        values: [],
        isDialog: "",
        colProps: 12,
        dialogWidth: 900,
        dialogHeight: 500,
        dialogMaximize: "",
        onOpen: init,
        onSubmit: submit
      }, {
        params: withCtx(() => [
          withDirectives(createVNode(unref(index), {
            class: "node-tree",
            data: params.value
          }, null, 8, ["data"]), [
            [_directive_loading, isLoading.value]
          ])
        ]),
        _: 1
      }, 8, ["visible", "config"]);
    };
  }
});
const apiMap = {
  freqscope: {
    list: getFreqScopes,
    add: addFreqScope,
    edit: updateFreqScope,
    remove: removeFreqScope,
    resultList: getFreqBands,
    addResult: addFreqBand,
    removeResult: removeFreqBand,
    removeKey: "freqScopeId",
    addKey: "freqScope",
    resultListKey: "freqScopeId",
    addResultKey: "freqBand",
    addResultCaseIdKey: "freqScopeId",
    removeResultKey: "freqBandId"
  },
  // 频段列表
  antennafactor: {
    list: getAntennaFactors,
    add: addAntennaFactory,
    edit: updateAntennaFactory,
    remove: removeAntennaFactory,
    resultList: getAntennaFactorResults,
    addResult: addAntennaFactorResult,
    removeResult: removeAntennaFactorResult,
    removeKey: "anttennaFactorId",
    addKey: "antennaFactorInfo",
    resultListKey: "antennaFactorId",
    addResultKey: "antennaFactorResult",
    addResultCaseIdKey: "antennaFactorId",
    removeResultKey: "antennaFactorResultId"
  },
  // 天线因子
  lineinfo: {
    getListApi: (type) => {
      return {
        Reference: getReferenceLines,
        Cable: getCableLines
      }[type];
    },
    add: addLine,
    remove: removeLine,
    edit: updateLine,
    getParams: getCreateLineParams,
    resultList: getLineCalResults,
    removeKey: "lineId",
    addKey: "line",
    resultListKey: "lineId"
  },
  // 链路校准
  positioninfo: {
    list: getPositionCalInfos,
    add: addPosition,
    remove: removePositionCal,
    edit: updatePositionCal,
    getParams: getCreatePositionParams,
    resultList: getPositionCalResults,
    removeKey: "postionCalId",
    addKey: "postionCal",
    editKey: "positionCal",
    resultListKey: "positionId"
  }
  // 位置校准
};
const tableMap = {
  freqscope: [
    { label: "开始频率(MHz)", prop: "startFreq", type: "editable", editType: "input" },
    { label: "截止频率(MHz)", prop: "stopFreq", type: "editable", editType: "input" },
    { label: "步进", prop: "step", type: "editable", editType: "input" }
  ],
  antennafactor: [
    { label: "频率(MHz)", prop: "freq", type: "editable", editType: "input" },
    { label: "值", prop: "value", type: "editable", editType: "input" }
  ],
  lineinfo: [
    { label: "频率(MHz)", prop: "frequency" },
    { label: "损耗(dB)", prop: "pathLoss" }
  ],
  positioninfo: [
    { label: "频率(MHz)", prop: "frequency" },
    { label: "损耗(dB)", prop: "pathLoss" },
    { label: "测试点场强(dBuV/m)", prop: "tsPower" },
    { label: "被测点场强(dBuV/m)", prop: "utPower" }
  ]
};
const chartMap = {
  antennafactor: {
    xKey: { name: "频率(MHz)", prop: "freq" },
    yKey: { name: "值", prop: "value" }
  },
  lineinfo: {
    xKey: { name: "频率(MHz)", prop: "frequency" },
    yKey: { name: "损耗(dB)", prop: "pathLoss" }
  },
  positioninfo: {
    xKey: { name: "频率(MHz)", prop: "frequency" },
    yKey: { name: "损耗(dB)", prop: "pathLoss" }
  }
};
const ajustSet = '<?xml version="1.0" standalone="no"?>\r\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\r\n<svg t="1750056592159" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7715" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256">\r\n	<path d="M288 64a128 128 0 0 1 123.968 96H960v64l-548.032 0.064a128 128 0 0 1-247.936 0L64 224v-64h100.032A128 128 0 0 1 288 64z m0 64a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m448 256a128 128 0 0 1 123.968 96H960v64l-100.032 0.064a128 128 0 0 1-247.936 0L64 544v-64h548.032A128 128 0 0 1 736 384z m0 64a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m-448 256a128 128 0 0 1 123.968 96H960v64l-548.032 0.064a128 128 0 0 1-247.936 0L64 864v-64h100.032A128 128 0 0 1 288 704z m0 64a64 64 0 1 0 0 128 64 64 0 0 0 0-128z" fill="currentColor" p-id="7716">\r\n	</path>\r\n</svg>\r\n';
const stopIcon = '<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<rect x="0.5" y="0.5" width="9" height="9" rx="1" fill="currentColor"/>\r\n</svg>\r\n';
const playIcon = '<svg width="8" height="10" viewBox="0 0 8 10" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M1.51759 0.163836C1.37061 0.0659351 1.19977 0.00970589 1.02329 0.00114763C0.846811 -0.00741063 0.671314 0.0320228 0.515525 0.115241C0.359736 0.19846 0.229498 0.322342 0.138706 0.47367C0.0479133 0.624997 -2.64291e-05 0.798093 1.09308e-08 0.974492V9.02551C-2.64291e-05 9.20191 0.0479133 9.375 0.138706 9.52633C0.229498 9.67766 0.359736 9.80154 0.515525 9.88476C0.671314 9.96798 0.846811 10.0074 1.02329 9.99885C1.19977 9.99029 1.37061 9.93407 1.51759 9.83616L7.56549 5.81066C7.69915 5.72167 7.80874 5.60113 7.88454 5.45971C7.96034 5.3183 8 5.16039 8 5C8 4.83961 7.96034 4.6817 7.88454 4.54029C7.80874 4.39887 7.69915 4.27833 7.56549 4.18934L1.51759 0.163836Z" fill="#333333"/>\r\n</svg>\r\n';
const folderIcon = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path id="Vector" d="M11.4102 3.5952C11.649 3.9348 11.3646 4.35 10.9488 4.35H0.6C0.44087 4.35 0.288258 4.28679 0.175736 4.17426C0.0632141 4.06174 0 3.90913 0 3.75V2.652C0 1.188 1.188 0 2.652 0H4.044C5.022 0 5.328 0.318 5.718 0.84L6.558 1.956C6.744 2.202 6.768 2.232 7.116 2.232H8.79C9.873 2.232 10.8312 2.7702 11.4102 3.5952ZM11.9898 5.8482C11.9893 5.68938 11.9259 5.53723 11.8134 5.4251C11.701 5.31297 11.5486 5.25 11.3898 5.25H0.6C0.44087 5.25 0.288258 5.31321 0.175736 5.42574C0.0632141 5.53826 0 5.69087 0 5.85V8.79C0 10.56 1.44 12 3.21 12H8.79C10.56 12 12 10.56 12 8.79L11.9898 5.8482ZM7.458 8.85H4.458C4.206 8.85 4.008 8.652 4.008 8.4C4.008 8.154 4.206 7.95 4.458 7.95H7.458C7.57735 7.95 7.69181 7.99741 7.7762 8.0818C7.86059 8.16619 7.908 8.28065 7.908 8.4C7.908 8.51935 7.86059 8.63381 7.7762 8.7182C7.69181 8.80259 7.57735 8.85 7.458 8.85Z" fill="#E3AE5D"/>\r\n</svg>\r\n';
const fileIcon = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path id="Vector" d="M10.8837 8.51163V3.48837C11.5479 3.2093 12 2.55628 12 1.81395C12 0.814884 11.1851 0 10.186 0C9.4493 0 8.7907 0.452093 8.51163 1.11628H3.48837C3.2093 0.452093 2.55628 0 1.81395 0C0.814884 0 0 0.814884 0 1.81395C0 2.5507 0.452093 3.2093 1.11628 3.48837V8.51163C0.452093 8.7907 0 9.44372 0 10.186C0 11.1851 0.814884 12 1.81395 12C2.5507 12 3.2093 11.5479 3.48837 10.8837H8.51163C8.7907 11.5479 9.44372 12 10.186 12C11.1851 12 12 11.1851 12 10.186C12 9.4493 11.5479 8.7907 10.8837 8.51163ZM9.99628 8.38326C9.93488 8.38884 9.87907 8.4 9.81767 8.41116C9.66698 8.43907 9.52186 8.4893 9.38233 8.56186C9.34884 8.5786 9.31535 8.59535 9.28186 8.61767C9.00279 8.77395 8.77395 9.00279 8.61767 9.28186C8.59535 9.31535 8.5786 9.34884 8.56186 9.38233C8.4893 9.52186 8.43907 9.66698 8.41116 9.81767C8.4 9.87907 8.38884 9.93488 8.38326 9.99628C8.37768 10.013 8.37768 10.0298 8.37768 10.0465H3.62233C3.61085 9.91013 3.58465 9.7754 3.54419 9.64465C3.53302 9.6 3.51628 9.54977 3.49395 9.50512C3.47721 9.46605 3.46047 9.42698 3.43814 9.38233C3.4214 9.34884 3.40465 9.31535 3.38233 9.28186C3.22605 9.00279 2.99721 8.77395 2.71814 8.61767C2.68465 8.59535 2.65116 8.5786 2.61767 8.56186C2.57302 8.53954 2.53395 8.52279 2.49488 8.50605C2.45023 8.48372 2.4 8.46698 2.35535 8.45581C2.22461 8.41535 2.08987 8.38915 1.95349 8.37768V3.62233C2.0986 3.61116 2.23256 3.58326 2.36651 3.5386C2.41674 3.52744 2.47256 3.50512 2.52279 3.48279C2.5507 3.47163 2.58419 3.45488 2.61767 3.43814C2.65116 3.4214 2.68465 3.40465 2.71814 3.38233C2.99721 3.22605 3.22605 2.99721 3.38233 2.71814C3.40465 2.68465 3.4214 2.65116 3.43814 2.61767C3.45488 2.58419 3.47163 2.5507 3.48279 2.52279C3.50512 2.47256 3.52744 2.41674 3.5386 2.36651C3.58326 2.23256 3.61116 2.0986 3.62233 1.95349H8.37768C8.38884 2.10419 8.41674 2.24372 8.46698 2.38326C8.47814 2.42791 8.49488 2.47814 8.51721 2.52279C8.52837 2.55628 8.54512 2.58419 8.56186 2.61767C8.5786 2.65116 8.59535 2.68465 8.61767 2.71814C8.77395 2.99721 9.00279 3.22605 9.28186 3.38233C9.31535 3.40465 9.34884 3.4214 9.38233 3.43814C9.41581 3.45488 9.44372 3.47163 9.47721 3.48279C9.52186 3.50512 9.57209 3.52186 9.61674 3.53302C9.75628 3.58326 9.89581 3.61116 10.0465 3.62233V8.37768C10.0298 8.37768 10.013 8.37768 9.99628 8.38326Z" fill="#37BA8B"/>\r\n</svg>\r\n';
const adjustIcon = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750043649877" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6928" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M598.114491 545.311646H425.884398c-18.321405 0-33.311646-14.990241-33.311646-33.311646s14.990241-33.311646 33.311646-33.311646h172.230093c18.321405 0 33.311646 14.990241 33.311646 33.311646s-14.990241 33.311646-33.311646 33.311646" p-id="6929"></path><path d="M545.312201 425.883843v172.232314c0 18.321405-14.990241 33.311646-33.311646 33.311646s-33.311646-14.990241-33.311646-33.311646v-172.232314c0-18.321405 14.990241-33.311646 33.311646-33.311646s33.311646 14.990241 33.311646 33.311646M205.58671 545.311646H33.354396c-18.321405 0-33.311646-14.990241-33.311646-33.311646s14.990241-33.311646 33.311646-33.311646H205.5856c18.321405 0 33.311646 14.990241 33.311646 33.311646 0.00111 18.321405-14.98913 33.311646-33.310536 33.311646M990.646714 545.311646h-172.232314c-18.321405 0-33.311646-14.990241-33.311646-33.311646s14.990241-33.311646 33.311646-33.311646h172.232314c18.321405 0 33.311646 14.990241 33.311646 33.311646s-14.990241 33.311646-33.311646 33.311646M546.848979 33.311646v172.233424c0 18.321405-14.990241 33.311646-33.311647 33.311647s-33.311646-14.990241-33.311646-33.311647V33.311646c0-18.321405 14.990241-33.311646 33.311646-33.311646s33.311646 14.990241 33.311647 33.311646M546.848979 818.45604V990.688354c0 18.321405-14.990241 33.311646-33.311647 33.311646s-33.311646-14.990241-33.311646-33.311646V818.45604c0-18.321405 14.990241-33.311646 33.311646-33.311646s33.311646 14.990241 33.311647 33.311646" p-id="6930"></path><path d="M513.538443 944.917042c-57.996686 0-114.276712-11.365934-167.276652-33.783561-51.174461-21.644797-97.126766-52.624628-136.58108-92.078942-39.454314-39.453203-70.434144-85.406619-92.078941-136.58108-22.416517-52.999939-33.783561-109.279965-33.783561-167.276651s11.365934-114.277823 33.783561-167.276652c21.644797-51.174461 52.625738-97.127877 92.078941-136.58108s85.406619-70.434144 136.58108-92.078942c52.999939-22.416517 109.279965-33.783561 167.276652-33.783561s114.276712 11.365934 167.276651 33.783561c51.174461 21.644797 97.127877 52.624628 136.58108 92.078942 39.454314 39.454314 70.434144 85.406619 92.078942 136.58108 22.416517 52.998829 33.783561 109.279965 33.783561 167.276652s-11.365934 114.276712-33.783561 167.276651c-21.644797 51.174461-52.624628 97.127877-92.078942 136.58108-39.453203 39.454314-85.406619 70.434144-136.58108 92.078942-52.999939 22.417627-109.279965 33.783561-167.276651 33.783561z m0-792.817176c-200.211876 0-363.096942 162.885066-363.096942 363.096942 0 200.212986 162.885066 363.096942 363.096942 363.096942 200.212986 0 363.096942-162.883956 363.096942-363.096942 0-200.211876-162.885066-363.096942-363.096942-363.096942z" p-id="6931"></path></svg>';
const adjustDelete = '<svg width="12" height="13" viewBox="0 0 12 13" xmlns="http://www.w3.org/2000/svg">\r\n<g id="Frame">\r\n<path id="Vector" d="M7.59597 9.28394H4.35597C4.12197 9.28394 3.93597 9.46994 3.93597 9.70394C3.93597 9.93794 4.12197 10.1239 4.35597 10.1239H7.59597C7.82397 10.1239 8.01597 9.93794 8.01597 9.70394C8.01597 9.46994 7.82997 9.28394 7.59597 9.28394Z" />\r\n<path id="Vector_2" d="M10.44 3.20003H8.34002V2.24003C8.34002 1.70981 7.91017 1.28003 7.38001 1.28003H4.62001C4.08985 1.28003 3.66001 1.70981 3.66001 2.24003V3.20003H1.56001C1.44862 3.20003 1.3418 3.24428 1.26303 3.32304C1.18426 3.40181 1.14001 3.50864 1.14001 3.62003C1.14001 3.73142 1.18426 3.83825 1.26303 3.91701C1.3418 3.99578 1.44862 4.04003 1.56001 4.04003H2.20735L2.59963 11.0025C2.62231 11.4055 2.93731 11.72 3.31831 11.72H8.68171C9.06271 11.72 9.37778 11.4055 9.40046 11.0025L9.79268 4.04003H10.44C10.5514 4.04003 10.6582 3.99578 10.737 3.91701C10.8158 3.83825 10.86 3.73142 10.86 3.62003C10.86 3.50864 10.8158 3.40181 10.737 3.32304C10.6582 3.24428 10.5514 3.20003 10.44 3.20003ZM4.50002 2.24003C4.50002 2.17385 4.55383 2.12003 4.62001 2.12003H7.38001C7.4462 2.12003 7.50001 2.17385 7.50001 2.24003V3.20003H4.50002V2.24003ZM8.56603 10.88H3.43399L3.04867 4.04003H8.95135L8.56603 10.88Z" />\r\n</g>\r\n</svg>\r\n';
const _hoisted_1$4 = { class: "tree-box" };
const _hoisted_2$1 = { class: "tit" };
const _hoisted_3$1 = ["innerHTML"];
const _hoisted_4$1 = ["innerHTML"];
const _hoisted_5$1 = ["innerHTML"];
const _hoisted_6$1 = { class: "custom-tree-node" };
const _hoisted_7$1 = ["innerHTML"];
const _hoisted_8$1 = ["innerHTML"];
const _hoisted_9 = ["innerHTML"];
const _hoisted_10 = { class: "more-v" };
const _hoisted_11 = ["innerHTML"];
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  ...{
    name: "LeftTree"
  },
  __name: "index",
  props: /* @__PURE__ */ mergeModels({
    currentKey: { default: "freqscope" }
  }, {
    "status": { default: 1 },
    "statusModifiers": {},
    "current": { default: () => ({}) },
    "currentModifiers": {}
  }),
  emits: ["update:status", "update:current"],
  setup(__props, { expose: __expose }) {
    const authStore = {
      calibrationName: "开场校准管理器"
    };
    const status = useModel(__props, "status");
    const current = useModel(__props, "current");
    const chooseItem = computed(() => current.value);
    const isAdjustItem = computed(() => !current.value.children && ["lineinfo", "positioninfo"].includes(String(current.value.pId)));
    const treeRef = ref();
    const loadTree = ref(false);
    const treeData = ref([
      { id: "freqscope", name: "频段列表", children: [] },
      { id: "antennafactor", name: "天线因子", children: [] },
      {
        id: "lineinfo",
        name: "链路校准",
        children: [
          { id: "Reference", name: "参考校准", children: [], pId: "lineinfo" },
          { id: "Cable", name: "线缆校准", children: [], pId: "lineinfo" }
        ]
      },
      { id: "positioninfo", name: "位置校准", children: [] }
    ]);
    const btnLoading = ref(false);
    const visible = ref(false);
    const configVisible = ref(false);
    onMounted(() => {
      var _a;
      current.value = treeData.value.length ? treeData.value[0] : {};
      (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey(current.value.id);
      Object.keys(apiMap).forEach((key) => {
        getTreeList(key);
      });
    });
    const handleNodeClick = (row) => {
      var _a;
      if (row.id === current.value.id) return;
      if (status.value === 2) {
        ElMessage.warning("处于校准中，请等待校准结束后查看");
        (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey(current.value.id);
        return;
      }
      current.value = row;
    };
    const getTreeList = async (key) => {
      console.log("key", key);
      const row = treeData.value.find((item) => item.id === key);
      if (!row) return;
      handleList(row, key);
    };
    const handleList = async (row, key) => {
      var _a;
      if (row.id === "lineinfo") {
        (_a = row.children) == null ? void 0 : _a.forEach((it) => {
          handleList(it, key);
        });
      } else {
        row && (row.loading = true);
        const { list, getListApi } = apiMap[key];
        const apiMethod = getListApi ? getListApi(row.id) : list;
        const { data } = await apiMethod({}, { calibrationName: authStore.calibrationName });
        row.children = (data === "[]" ? JSON.parse(data) : data || []).map((item) => {
          item.pId = key;
          item.pName = row.name;
          return item;
        });
        const chooseRow = row.children.find((item) => item.id === current.value.id);
        chooseRow && (current.value = chooseRow);
        row.loading = false;
      }
    };
    const handleDel = async ({ id, pId, name }) => {
      const { remove, removeKey } = apiMap[pId];
      await ElMessageBox({
        title: "提示",
        message: `是否确定删除“${name}”?`,
        type: "warning",
        showCancelButton: true,
        beforeClose: async (action, instance, done) => {
          if (action === "confirm") {
            try {
              instance.confirmButtonLoading = true;
              instance.confirmButtonText = `执行中...`;
              await remove({ [removeKey]: id }, {
                calibrationName: authStore.calibrationName
              });
              done();
            } catch {
              instance.confirmButtonText = `确定`;
            }
            instance.confirmButtonLoading = false;
          } else {
            done();
          }
        }
      });
      ElMessage.closeAll();
      ElMessage.success(`删除成功`);
      getTreeList(pId);
    };
    const handleStart = async () => {
      try {
        btnLoading.value = true;
        const { id, pId } = current.value;
        await startAdjust(
          { calibrationType: pId === "lineinfo" ? "Line" : "Position", calirbationId: String(id || "") },
          { calibrationName: authStore.calibrationName }
        );
        status.value = 2;
        btnLoading.value = false;
      } catch (err) {
        console.log("err", err);
        btnLoading.value = false;
      }
    };
    const handleStop = async () => {
      try {
        btnLoading.value = true;
        await stopAdjust({}, { calibrationName: authStore.calibrationName });
        status.value = 1;
        btnLoading.value = false;
      } catch (err) {
        btnLoading.value = false;
      }
    };
    const openAddDialog = (row) => {
      current.value = row;
      visible.value = true;
    };
    __expose({ handleStop });
    return (_ctx, _cache) => {
      const _component_i_ep_loading = resolveComponent("i-ep-loading");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
      const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
      const _component_el_dropdown = resolveComponent("el-dropdown");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      const _directive_loading = resolveDirective("loading");
      return openBlock(), createElementBlock("div", _hoisted_1$4, [
        createElementVNode("div", _hoisted_2$1, [
          _cache[4] || (_cache[4] = createElementVNode("div", { class: "name" }, "校准列表", -1)),
          createElementVNode("span", {
            class: "set force-svg-16 svgWHSet",
            innerHTML: unref(ajustSet),
            onClick: _cache[0] || (_cache[0] = ($event) => configVisible.value = true)
          }, null, 8, _hoisted_3$1),
          isAdjustItem.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
            status.value === 2 ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: "btns stop-btns",
              title: "结束校准",
              onClick: handleStop
            }, [
              createElementVNode("span", { innerHTML: unref(stopIcon) }, null, 8, _hoisted_4$1)
            ])) : (openBlock(), createElementBlock("div", {
              key: 1,
              class: "btns",
              title: "开始校准",
              onClick: handleStart
            }, [
              createElementVNode("span", { innerHTML: unref(playIcon) }, null, 8, _hoisted_5$1)
            ]))
          ], 64)) : createCommentVNode("", true)
        ]),
        withDirectives((openBlock(), createBlock(_component_el_scrollbar, {
          ref: "treeScroll",
          style: { "height": "calc(100% - 53px)" }
        }, {
          default: withCtx(() => [
            createVNode(unref(ElTree), {
              ref_key: "treeRef",
              ref: treeRef,
              data: treeData.value,
              "highlight-current": true,
              props: { label: "name" },
              "node-key": "id",
              "expand-on-click-node": false,
              "default-expand-all": "",
              "icon-class": "el-icon-arrow-right",
              "current-node-key": current.value.id,
              onNodeClick: handleNodeClick
            }, {
              default: withCtx(({ data }) => [
                createElementVNode("div", _hoisted_6$1, [
                  data.children ? (openBlock(), createElementBlock("span", {
                    key: 0,
                    innerHTML: unref(folderIcon)
                  }, null, 8, _hoisted_7$1)) : (openBlock(), createElementBlock("span", {
                    key: 1,
                    innerHTML: unref(fileIcon)
                  }, null, 8, _hoisted_8$1)),
                  data.loading ? (openBlock(), createBlock(_component_i_ep_loading, {
                    key: 2,
                    class: "el-icon-loading"
                  })) : createCommentVNode("", true),
                  createVNode(unref(TooltipBox), {
                    content: data.name,
                    tooltipAttrs: { placement: "right", offset: 38 }
                  }, null, 8, ["content"]),
                  current.value.id === data.id && status.value === 2 && isAdjustItem.value ? (openBlock(), createElementBlock("span", {
                    key: 3,
                    class: "adjust-icon",
                    innerHTML: unref(adjustIcon),
                    size: 16
                  }, null, 8, _hoisted_9)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [
                    !data.children ? (openBlock(), createBlock(_component_el_dropdown, {
                      key: 0,
                      class: "dropdown-box",
                      trigger: "hover",
                      placement: "bottom-start",
                      "popper-class": "dropdown-poper"
                    }, {
                      dropdown: withCtx(() => [
                        createVNode(_component_el_dropdown_menu, {
                          slot: "dropdown",
                          class: "handle-dropdown"
                        }, {
                          default: withCtx(() => [
                            createVNode(_component_el_dropdown_item, {
                              class: "edit",
                              onClick: ($event) => openAddDialog(data)
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_el_icon, null, {
                                  default: withCtx(() => [
                                    createVNode(unref(Edit))
                                  ]),
                                  _: 1
                                }),
                                _cache[5] || (_cache[5] = createTextVNode(" 编辑 ", -1))
                              ]),
                              _: 2
                            }, 1032, ["onClick"]),
                            createVNode(_component_el_dropdown_item, {
                              class: "del",
                              onClick: ($event) => handleDel(data)
                            }, {
                              default: withCtx(() => [
                                createElementVNode("span", { innerHTML: unref(adjustDelete) }, null, 8, _hoisted_11),
                                _cache[6] || (_cache[6] = createTextVNode(" 删除 ", -1))
                              ]),
                              _: 2
                            }, 1032, ["onClick"])
                          ]),
                          _: 2
                        }, 1024)
                      ]),
                      default: withCtx(() => [
                        createElementVNode("div", _hoisted_10, [
                          createVNode(_component_el_icon, null, {
                            default: withCtx(() => [
                              createVNode(unref(MoreFilled))
                            ]),
                            _: 1
                          })
                        ])
                      ]),
                      _: 2
                    }, 1024)) : data.children.some((it) => !it.children) ? (openBlock(), createBlock(_component_el_icon, {
                      key: 1,
                      class: "add",
                      onClick: ($event) => openAddDialog(data)
                    }, {
                      default: withCtx(() => [
                        createVNode(unref(CirclePlus))
                      ]),
                      _: 2
                    }, 1032, ["onClick"])) : createCommentVNode("", true)
                  ], 64))
                ])
              ]),
              _: 1
            }, 8, ["data", "current-node-key"])
          ]),
          _: 1
        })), [
          [_directive_loading, loadTree.value]
        ]),
        createVNode(_sfc_main$6, {
          modelValue: visible.value,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
          detail: chooseItem.value,
          apiConfig: unref(apiMap)[_ctx.currentKey],
          currentKey: _ctx.currentKey,
          onUpdate: _cache[2] || (_cache[2] = ($event) => getTreeList(_ctx.currentKey))
        }, null, 8, ["modelValue", "detail", "apiConfig", "currentKey"]),
        createVNode(_sfc_main$5, {
          modelValue: configVisible.value,
          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => configVisible.value = $event)
        }, null, 8, ["modelValue"])
      ]);
    };
  }
});
const _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const LeftTree = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-c14eb087"]]);
const _hoisted_1$3 = { class: "chart-view" };
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  ...{
    name: "ChartView",
    components: {}
  },
  __name: "ChartView",
  props: {
    currentKey: { default: "antennafactor" }
  },
  setup(__props, { expose: __expose }) {
    let lineChart = null;
    const props = __props;
    const config2 = computed(() => chartMap[props.currentKey] || {});
    const lineChartRef = ref();
    const dataLen = ref(0);
    onBeforeUnmount(() => {
      window.removeEventListener("resize", chartResize);
    });
    onMounted(async () => {
      nextTick(() => {
        initEchart();
      });
    });
    const initEchart = () => {
      lineChart = echarts.init(lineChartRef.value);
      lineChart.setOption(getChartJson());
      window.addEventListener("resize", chartResize);
    };
    const chartResize = () => {
      lineChart.resize();
    };
    const drawChart = (data) => {
      dataLen.value = data.length;
      lineChart.clear();
      lineChart.setOption(getChartJson(data));
      nextTick(() => {
        chartResize();
      });
    };
    const getChartJson = (data = []) => {
      var _a, _b, _c;
      return {
        grid: {
          top: 50,
          left: 60,
          right: 20,
          bottom: 40
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            lineStyle: {
              color: "#3A6EF6",
              width: 2
            }
          },
          // triggerOn: "click",
          className: "adjust-tooltip-box",
          textStyle: {
            color: "#1d2129",
            fontSize: 12
          },
          padding: 8,
          formatter: (vals) => {
            const { value, axisValue, seriesName } = vals[0];
            return `<div class="tit">${axisValue}</div>
          <div class="name-val">
            <span class="name">${seriesName}</span>
            <span class="val">${value}</span>
          </div>`;
          }
        },
        xAxis: {
          type: "category",
          name: (_a = config2.value.xKey) == null ? void 0 : _a.name,
          nameTextStyle: {
            padding: [-20, 0, 0, -60],
            color: "#666",
            verticalAlign: "top"
          },
          boundaryGap: false,
          axisLine: {
            onZero: false,
            lineStyle: {
              color: "#ddd"
            }
          },
          axisLabel: {
            color: "#999"
            // interval: 4
          },
          data: data.map((item) => {
            var _a2;
            return item[(_a2 = config2.value.xKey) == null ? void 0 : _a2.prop];
          })
        },
        yAxis: {
          type: "value",
          name: (_b = config2.value.yKey) == null ? void 0 : _b.name,
          nameTextStyle: {
            padding: [0, 0, 5, 0]
          },
          splitLine: {
            show: true,
            lineStyle: {
              type: "dashed",
              color: "#ddd"
            }
          },
          axisLabel: {
            color: "#999"
          }
        },
        series: [
          {
            type: "line",
            data: data.map((item) => {
              var _a2;
              return item[(_a2 = config2.value.yKey) == null ? void 0 : _a2.prop];
            }),
            symbolSize: 12,
            name: (_c = config2.value.yKey) == null ? void 0 : _c.name,
            lineStyle: {
              color: {
                type: "linear",
                x: 0,
                y: 0,
                x2: 1,
                y2: 0,
                colorStops: [
                  { offset: 0, color: "#13DAF1" },
                  { offset: 1, color: "#3A6EF6" }
                ],
                global: false
              }
            },
            itemStyle: {
              color: "#3A6EF6",
              borderWidth: 2,
              borderColor: "#3A6EF6",
              opacity: 0
            },
            emphasis: {
              itemStyle: {
                opacity: 1
              }
            }
          }
        ]
      };
    };
    __expose({ chartResize, drawChart });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3, [
        withDirectives(createElementVNode("div", {
          ref_key: "lineChartRef",
          ref: lineChartRef,
          class: "chart-box"
        }, null, 512), [
          [vShow, dataLen.value]
        ]),
        withDirectives(createVNode(unref(Empty), null, null, 512), [
          [vShow, !dataLen.value]
        ])
      ]);
    };
  }
});
const ChartView = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-ef0c1092"]]);
const _hoisted_1$2 = { class: "params-view" };
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "ParamsView",
  props: {
    current: { default: () => ({}) },
    currentKey: { default: "antennafactor" }
  },
  setup(__props) {
    const authStore = {
      calibrationName: "开场校准管理器"
    };
    const props = __props;
    const handleUpdate = async () => {
      console.log("current.params", props.current.params);
      const { edit, editKey, addKey } = apiMap[props.currentKey];
      await edit(
        {
          [editKey || addKey]: props.current
        },
        { calibrationName: authStore.calibrationName }
      );
      ElMessage.success("参数更新成功");
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2, [
        _cache[0] || (_cache[0] = createElementVNode("div", { class: "tit" }, "参数", -1)),
        createVNode(unref(index), {
          class: "node-tree",
          ref: "nodeTreeRef",
          data: _ctx.current.params || [],
          onUpdateForm: handleUpdate
        }, null, 8, ["data"])
      ]);
    };
  }
});
const ParamsView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-676b439c"]]);
const _hoisted_1$1 = { class: "adjust-table" };
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "TableBox",
  props: {
    data: { default: () => [] },
    current: { default: () => ({}) },
    isEdit: { type: Boolean, default: false },
    loading: { type: Boolean, default: false }
  },
  emits: ["update", "updateChart"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const authStore = {
      calibrationName: "开场校准管理器"
    };
    const emits = __emit;
    const props = __props;
    const titleList = computed(() => tableMap[props.current.pId]);
    const tableView = ref();
    const editable = ref({
      editText: "",
      onSave: async (row, done) => {
        delete row.isEditable;
        const { addResultKey, addResult, addResultCaseIdKey } = apiMap[props.current.pId];
        await addResult({ [addResultKey]: { ...row, [addResultCaseIdKey]: props.current.id } }, { calibrationName: authStore.calibrationName });
        done && done(false, row);
        emits("update");
        emits("updateChart");
      },
      onDelete: async (row) => {
        const { removeResultKey, removeResult } = apiMap[props.current.pId];
        await removeResult({ [removeResultKey]: row.id }, { calibrationName: authStore.calibrationName });
        emits("updateChart");
      }
    });
    const scrollBottom = (isReset = false) => {
      nextTick(() => {
        const table = tableView.value.table.layout.table.refs;
        const ele = table.bodyWrapper.firstElementChild.firstElementChild;
        ele.scrollTop = isReset ? 0 : ele.scrollHeight;
      });
    };
    __expose({ scrollBottom });
    return (_ctx, _cache) => {
      const _component_XcTable = resolveComponent("XcTable");
      return openBlock(), createElementBlock("div", _hoisted_1$1, [
        createVNode(_component_XcTable, {
          ref_key: "tableView",
          ref: tableView,
          state: _ctx.loading ? "loading" : "",
          indexColumn: false,
          isFullLayout: "",
          highlightCurrentRow: "",
          config: titleList.value,
          values: _ctx.data,
          isEditable: _ctx.isEdit,
          editable: editable.value
        }, null, 8, ["state", "config", "values", "isEditable", "editable"])
      ]);
    };
  }
});
const TableBox = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c5de6b70"]]);
const _hoisted_1 = {
  ref: "split",
  class: "split"
};
const _hoisted_2 = {
  ref: "leftView",
  class: "left-view"
};
const _hoisted_3 = {
  ref: "rightView",
  class: "right-view"
};
const _hoisted_4 = { class: "right-ct" };
const _hoisted_5 = { class: "tit" };
const _hoisted_6 = {
  ref: "chartTable",
  class: "chart-table"
};
const _hoisted_7 = {
  ref: "chartBox",
  class: "chart-box"
};
const _hoisted_8 = {
  ref: "paramsBox",
  class: "params-box"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "CalibrationList"
  },
  __name: "index",
  setup(__props, { expose: __expose }) {
    const dataEvent = (data) => {
      console.log("子组件收到数据了", data);
    };
    __expose({
      dataEvent
    });
    const calibrationStore = useCalibrationStore();
    console.log("存储后 Pinia 中的值：", calibrationStore.sendCalibrationCmd);
    const leftTreeRef = ref();
    const chartView = ref();
    const tableBoxRef = ref();
    const paramsView = ref();
    const currentKey = computed(() => currentCase.value.pId || currentCase.value.id);
    const isEdit = computed(() => {
      const { children, pId } = currentCase.value;
      return !(children || ["lineinfo", "positioninfo"].includes(pId));
    });
    const chartData = ref([]);
    const chartLoading = ref(false);
    const currentCase = ref({});
    const adjustStatus = ref(1);
    watch(
      () => currentCase.value.id,
      () => {
        if (currentCase.value.children) {
          chartData.value = [];
        } else {
          getChartData();
        }
      }
    );
    watch(adjustStatus, (_, oldVal) => {
      if (oldVal === 1) {
        chartData.value = [];
      }
    });
    onMounted(() => {
      initSplit();
    });
    const initSplit = () => {
      var _a;
      const { leftView, rightView, chartTable, paramsBox, chartBox, tableBox, chartView: chartView2 } = ((_a = getCurrentInstance()) == null ? void 0 : _a.refs) || {};
      const options = [
        { el: [leftView, rightView], direction: "horizontal", sizes: [13, 87] },
        { el: [chartBox, tableBox], direction: "vertical", sizes: [60, 40], minSize: [50, 50] },
        { el: [chartTable, paramsBox], direction: "horizontal", sizes: [70, 30], minSize: [50, 50] }
      ];
      options.forEach((x) => {
        Split(x.el, {
          snapOffset: 0,
          gutterSize: 10,
          onDrag: () => {
            chartView2 == null ? void 0 : chartView2.chartResize();
          },
          ...x
        });
      });
    };
    const updateChart = () => {
      var _a;
      (_a = chartView.value) == null ? void 0 : _a.drawChart(chartData.value);
    };
    const getChartData = async () => {
      const { resultList, resultListKey } = apiMap[currentKey.value];
      chartLoading.value = true;
      const { data } = await resultList(
        {
          [resultListKey]: currentCase.value.id || ""
        },
        { calibrationName: "开场校准管理器" }
      );
      chartLoading.value = false;
      chartData.value = data || [];
      updateChart();
    };
    return (_ctx, _cache) => {
      const _directive_loading = resolveDirective("loading");
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          createVNode(LeftTree, {
            ref_key: "leftTreeRef",
            ref: leftTreeRef,
            current: currentCase.value,
            "onUpdate:current": _cache[0] || (_cache[0] = ($event) => currentCase.value = $event),
            status: adjustStatus.value,
            "onUpdate:status": _cache[1] || (_cache[1] = ($event) => adjustStatus.value = $event),
            currentKey: currentKey.value
          }, null, 8, ["current", "status", "currentKey"])
        ], 512),
        createElementVNode("div", _hoisted_3, [
          createElementVNode("div", _hoisted_4, [
            createElementVNode("div", _hoisted_5, [
              createElementVNode("span", null, toDisplayString(currentCase.value.name), 1)
            ]),
            createElementVNode("div", {
              class: normalizeClass(`r-ct ${currentKey.value}`)
            }, [
              createElementVNode("div", _hoisted_6, [
                withDirectives((openBlock(), createElementBlock("div", _hoisted_7, [
                  createVNode(ChartView, {
                    ref_key: "chartView",
                    ref: chartView,
                    class: "chart-view",
                    currentKey: currentKey.value
                  }, null, 8, ["currentKey"])
                ])), [
                  [_directive_loading, chartLoading.value]
                ]),
                createElementVNode("div", {
                  ref: "tableBox",
                  class: "table-box",
                  style: normalizeStyle(`margin-top: ${isEdit.value ? 38 : 0}px`)
                }, [
                  createVNode(TableBox, {
                    ref_key: "tableBoxRef",
                    ref: tableBoxRef,
                    data: chartData.value,
                    current: currentCase.value,
                    isEdit: isEdit.value,
                    loading: chartLoading.value,
                    onUpdate: getChartData,
                    onUpdateChart: updateChart
                  }, null, 8, ["data", "current", "isEdit", "loading"])
                ], 4)
              ], 512),
              createElementVNode("div", _hoisted_8, [
                createVNode(ParamsView, {
                  ref_key: "paramsView",
                  ref: paramsView,
                  class: "params-view",
                  current: currentCase.value,
                  currentKey: currentKey.value
                }, null, 8, ["current", "currentKey"])
              ], 512)
            ], 2)
          ])
        ], 512)
      ], 512);
    };
  }
});
const CalibrationForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a5d5b097"]]);
const config = {
  moudleType: "CalibrationForm",
  name: "校准模块",
  version: "1.0.0",
  description: "校准模块"
};
class CalibrationModule {
  constructor(sendCmd, initialData = {}) {
    __publicField(this, "config", config);
    __publicField(this, "_eventData");
    __publicField(this, "sendCmd");
    this._eventData = ref(initialData);
    this.sendCmd = sendCmd;
  }
  sendCommand(cmd, cmdParams) {
    console.log("发送指令：", cmd, cmdParams);
    return this.sendCmd(this.config.moudleType, cmd, cmdParams);
  }
  install(app) {
    app.component("CalibrationForm", CalibrationForm);
    app.provide(GET_CALIBRATION_DATA_KEY, () => this.eventData);
    app.provide(SEND_CALIBRATION_CMD_KEY, (cmd, cmdParams) => {
      console.log("插件内部转发指令：", cmd, cmdParams);
      return this.sendCommand(cmd, cmdParams);
    });
  }
  get eventData() {
    return this._eventData;
  }
  dataEvent(data) {
    Object.assign(this._eventData, data);
  }
  async startup() {
    const calibrationStore = useCalibrationStore();
    if (!calibrationStore.sendCalibrationCmd) {
      console.log("Pinia 中未存储 sendCalibrationCmd,进行存储");
      calibrationStore.setInjections({
        sendCalibrationCmd: (cmd, cmdParams) => this.sendCommand(cmd, cmdParams)
      });
    }
    console.log("插件根组件获取到 sendCalibrationCmd,初始化成功", calibrationStore.sendCalibrationCmd);
    console.log("存储后 Pinia 中的值：", calibrationStore.sendCalibrationCmd);
    console.log("校准模块初始化完成");
  }
}
const createCalibrationModule = (sendCmd, initialData) => {
  return new CalibrationModule(sendCmd, initialData);
};
export {
  CalibrationForm,
  createCalibrationModule,
  CalibrationForm as default
};
